{%- set neighbor_info_list = []                                                                                                   %}
{%- for lldp_neighbor in device_info.get('results', [])                                                                           %}
{%-     set lldp_neighbor_information = lldp_neighbor['parsed_output']['lldp-neighbors-information']['lldp-neighbor-information'] %}
{%-     if lldp_neighbor_information is mapping                                                                                   %}
{%-         set lldp_neighbor_information = [ lldp_neighbor_information]                                                          %}
{%-     endif                                                                                                                     %}
{%-     for lldp_neighbor_info in lldp_neighbor_information                                                                       %}
{%-         if lldp_neighbor_info.get('lldp-remote-system-name') is none                                                          %}
{%-             continue                                                                                                          %}
{%-         else                                                                                                                  %}
{%-             set remote_prouter_name = lldp_neighbor_info.get('lldp-remote-system-name')                                       %}
{%-             set remote_phy_int = lldp_neighbor_info.get('lldp-remote-port-id')                                                %}
{%-             set local_phy_int = lldp_neighbor.get('item')                                                                     %}
{%-             if '.' not in local_phy_int                                                                                       %}
{%-                 set x = neighbor_info_list.append({
                                                     "local_physical_interface_name":
                                                     local_phy_int,
                                                     "remote_device_name":
                                                     remote_prouter_name,
                                                     "remote_physical_interface_port_id":
                                                     remote_phy_int
                                                })                                                                                %}
{%-             endif                                                                                                             %}
{%-         endif                                                                                                                 %}
{%-     endfor                                                                                                                    %}
{%- endfor                                                                                                                        %}
{
  "neighbor_info_list": {{ neighbor_info_list }}
}
